#include "garmin_tables.h"
#include "garmin_fs.h"
+#define SOON 1
+
#define MYNAME "GARMIN"
static const char *portname;
static short_handle mkshort_handle;
static char *snlen = NULL;
static char *snwhiteopt = NULL;
static char *deficon = NULL;
+static char *category = NULL;
+
/* Technically, even this is a little loose as spaces arent allowed */
static char valid_waypt_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789";
NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
{ "power_off", &poweroff, "Command unit to power itself down",
NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
+ { "category", &category, "Command unit to power itself down",
+ NULL, ARGTYPE_INT, "0", "15"},
ARG_TERMINATOR
};
wpt_tmp->icon_descr = d103_symbol_from_icon_number(
way[i]->smbl);
} else {
+ int dyn = 0;
wpt_tmp->icon_descr = gt_find_desc_from_icon_number(
- way[i]->smbl, PCX, NULL);
+ way[i]->smbl, PCX, &dyn);
+ wpt_tmp->wpt_flags.icon_descr_is_dynamic = dyn;
}
/*
* If a unit doesn't store altitude info (i.e. a D103)
if (way[i]->time_populated) {
wpt_tmp->creation_time = way[i]->time;
}
-#if 0
+#if SOON
garmin_fs_garmin_after_read(way[i], wpt_tmp, gps_waypt_type);
#endif
waypt_add(wpt_tmp);
way[i]->time = wpt->creation_time;
way[i]->time_populated = 1;
}
-#if 0
+ if (category) {
+ way[i]->category = 1 << atoi(category);
+ }
+#if SOON
garmin_fs_garmin_before_write(wpt, way[i], gps_waypt_type);
#endif
i++;
case 'p':
optarg = argv[argn][2] ? argv[argn]+2 : argv[++argn];
inifile_done(global_opts.inifile);
- if (strcmp(optarg, "") == 0) /* from GUI to preserve inconsistent options */
+ if (!optarg || strcmp(optarg, "") == 0) /* from GUI to preserve inconsistent options */
global_opts.inifile = NULL;
else
global_opts.inifile = inifile_init(optarg, MYNAME);